/*
 * NyuSymtbl.cpp
 *
 *  Created on: 2010/05/24
 *      Author: mitsu
 */

#include "NyuSymtbl.hpp"

NyuSymtbl::NyuSymtbl() {
}

NyuSymtbl::~NyuSymtbl() {
}

void NyuSymtbl::initialize() {
    instance_ = new NyuSymtbl();
}

void NyuSymtbl::finalize() {
    delete instance_;
}

unsigned int NyuSymtbl::getIndex(void* str, int) {
    idx_map_t::iterator it = idx_map_.find(str);
    if (it != idx_map_.end())
        return it->second;

    unsigned int ret = (unsigned int)idx_map_.size();
    idx_map_[str] = ret;

    return ret;
}

NyuSymtbl* NyuSymtbl::instance_ = 0;
